class ServerException implements Exception {}

class CacheException implements Exception {}


class UnsuccessfulDataInteractionException implements Exception {
  final String cause;

  UnsuccessfulDataInteractionException(this.cause);

  @override
  String toString() {
    return cause;
  }
}

class HiveDataNotFoundException implements Exception {
  final Type type;
  final String message;

  HiveDataNotFoundException({
    required this.type,
    this.message = 'Data was not found into local storage.',
  });

  @override
  String toString() {
    return '[${type.toString()}] $message';
  }
}

class HiveListInsertionException implements Exception {
  final Type type;
  final String message;

  HiveListInsertionException({
    required this.type,
    this.message = 'Error while list insertion to local storage.',
  });

  @override
  String toString() {
    return '[${type.toString()}] $message';
  }
}

class EmptyResponseException implements Exception {
  final String message;

  EmptyResponseException({
    this.message = 'Response data is null or empty.',
  });

  @override
  String toString() {
    return message;
  }
}
